//收件箱

import React from 'react';
import { Divider, List, Typography, Button } from 'antd';

const MailBox = ({ title = '收件箱', data = [], onReturn, returnButtonText = '返回' }) => (
  <>
    <Divider orientation="left">{title}</Divider>
    <List
      header={<div>{title}</div>}
      bordered
      dataSource={data}
      renderItem={(item, index) => (
        <List.Item key={index}>
          <Typography.Text mark>[MESSAGE]</Typography.Text> {item.content || item} {/* 假设item是对象且有content属性 */}
        </List.Item>
      )}
    />
    <Button type="primary" onClick={onReturn} style={{ marginTop: 16 }}>
      {returnButtonText}
    </Button>
  </>
);

export default MailBox;